package com.qiaoan.back.dao.sys;

import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import com.qiaoan.back.dao.SqlMapper;
import com.qiaoan.back.model.sys.UserModel;
@Repository
public interface UserDao extends SqlMapper {


	/**
	 *
	 * @param user
	 * @return
	 */
	int insert(UserModel user);

	/**
	 *
	 * @param id
	 * @return
	 */
	@Select("SELECT * FROM t_user WHERE id = #{id} ")
	UserModel getUserById(Integer id);

	/**
	 *
	 * @param username
	 * @param password
	 * @return
	 */
	@Select("SELECT * FROM t_user WHERE user_name = #{username}  AND password = #{password}")
	UserModel getUserByNamePwd(String username, String password);

	/**
	 *
	 * @param username
	 * @return
	 */
	@Select("SELECT * FROM t_user WHERE user_name = #{username} ")
    UserModel getUserByUsername(String username);
}
